package com.eds.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.eds.dto.BackOrderDTO;
import com.eds.dto.BackOrdersBoardDTO;
import com.eds.dto.DashboardTrendsDTO;
import com.eds.dto.PageUtils;
import com.eds.pojo.BaseResult;
import com.pojo.Orders;

import java.math.BigDecimal;

/**
 * @author 34195
 * @description 针对表【order】的数据库操作Service
 * @createDate 2025-03-31 21:05:09
 */
public interface OrdersService extends IService<Orders> {
    // 创建订单
    Boolean createOrders(Orders orders);

    // 根据订单id查询订单
    Orders selectOrdersByOrdersId(String ordersId);

    // 取消订单
    Boolean cancelOrders(String ordersId);

    // 更新订单支付状态
    Boolean updateOrdersPayStatus(String ordersId, String paymentChannel, String tradeNo, String buyerLogonId, String buyerPayAmount);

    // 根据排课id、用户id、课程id查询订单
    Orders selectOrdersByScheduleUserCourseId(Long scheduleId, Long userId, Long courseId);

    // 退款
    BaseResult refundAndCancelBooking(String token, String scheduleId);

    // 更新免费订单
    Orders updateOrdersPayFreeStatus(String ordersId, BigDecimal paymentAmount, String paymentChannel, String transactionId);

    // 发送订单支付成功消息
    Void sendOrdersPaySuccessMessage(String token, String ordersId);

    // 查询所有订单
    PageUtils<BackOrderDTO> selectAllOrders(int currentPage, int pageSize);

    // 获取订单板块
    BackOrdersBoardDTO getOrdersBoard();

    // 获取订单趋势
    DashboardTrendsDTO getDashboardTrends();
}
